home *** CD-ROM | disk | FTP | other *** search
/ The Sunday Times: The Month 2004 October / The Sunday Times - The Month 2004-10.iso / pc / assets / bespoke / feature / movies / section4.swf / scripts / frame_1 / DoAction.as
Text File  |  2004-09-05  |  24KB  |  758 lines

  1. function monitorLoad(what)
  2. {
  3.    var _loc1_ = what;
  4.    if(_loc1_.sound.getBytesTotal() == _loc1_.sound.getBytesLoaded())
  5.    {
  6.       _loc1_.sound.stop();
  7.       _loc1_.sound.start();
  8.       FeatureUnit9.removeInterval(_loc1_.intervalID);
  9.    }
  10. }
  11. _global.FeatureUnit9 = {};
  12. FeatureUnit9.utils = {};
  13. FeatureUnit9.utils.over = function(clip)
  14. {
  15.    if(clip.hitTest(_level0._xmouse,_level0._ymouse,false))
  16.    {
  17.       return true;
  18.    }
  19.    return false;
  20. };
  21. FeatureUnit9.utils.lingoRoll = function()
  22. {
  23.    if(FeatureUnit9.runtime)
  24.    {
  25.       getUrl("lingo: cursor 280", "");
  26.    }
  27. };
  28. FeatureUnit9.utils.lingoRollOut = function()
  29. {
  30.    if(FeatureUnit9.runtime)
  31.    {
  32.       getUrl("lingo: cursor -1", "");
  33.    }
  34. };
  35. FeatureUnit9.utils.getOsInfo = function()
  36. {
  37.    var _loc1_ = {};
  38.    _loc1_.maxSounds = 6;
  39.    switch(system.capabilities.os)
  40.    {
  41.       case "Windows XP":
  42.          break;
  43.       case "Windows 2000":
  44.          break;
  45.       case "Windows NT":
  46.          break;
  47.       case "Windows 98/ME":
  48.          break;
  49.       case "Windows 95":
  50.          break;
  51.       case "MacOS":
  52.    }
  53.    return _loc1_;
  54. };
  55. _global.lingo = function(str)
  56. {
  57.    getURL("lingo:" + str,"");
  58. };
  59. fullscreenOpen = function()
  60. {
  61.    lingo("FeatureUnit9FullscreenOpen()");
  62. };
  63. fullscreenClose = function()
  64. {
  65.    lingo("FeatureUnit9FullscreenClose()");
  66. };
  67. exampleLink = function()
  68. {
  69.    this.unloadMovie();
  70.    lingo("FeatureUnit9Link(2,\"#0\")");
  71. };
  72. webPageOpen = function(strURL)
  73. {
  74.    lingo("Flsh_webPageOpen(\"" + strURL + "\")");
  75. };
  76. emailOpen = function(strEmailAddress, strSubject)
  77. {
  78.    lingo("Flsh_openEmail(\"" + strEmailAddress + "\",\"" + strSubject + "\")");
  79. };
  80. close = function()
  81. {
  82. };
  83. FeatureUnit9.utils.cursor = function(what)
  84. {
  85.    trace("cursor change");
  86.    if(FeatureUnit9.runtime)
  87.    {
  88.       lingo("cursor " + String(what));
  89.    }
  90. };
  91. FeatureUnit9.objtrace = function(what)
  92. {
  93.    var _loc2_ = what;
  94.    trace("-----------------------------");
  95.    var _loc1_ = undefined;
  96.    for(_loc1_ in _loc2_)
  97.    {
  98.       trace(_loc1_ + ":" + _loc2_[_loc1_]);
  99.    }
  100.    trace("-----------------------------");
  101. };
  102. if(_global.Tardis == undefined)
  103. {
  104.    _global.Tardis = {};
  105.    Tardis.Settings = {};
  106.    if(_global.Feature == undefined)
  107.    {
  108.       Tardis.Settings.FeatureUnit9_ASSETS = "";
  109.    }
  110.    else
  111.    {
  112.       Tardis.Settings.FeatureUnit9_ASSETS = "movies/";
  113.    }
  114. }
  115. FeatureUnit9.timeLine = this;
  116. FeatureUnit9.path = Tardis.Settings.FeatureUnit9_ASSETS;
  117. FeatureUnit9.intervals = {};
  118. FeatureUnit9.runtime = false;
  119. FeatureUnit9.stageWidth = 770;
  120. FeatureUnit9.stageHeight = 395;
  121. FeatureUnit9.structure = [1,3];
  122. FeatureUnit9.ambientSounds = [false,true];
  123. FeatureUnit9.introSounds = [[false],[false,false,false]];
  124. FeatureUnit9.ambientFirst = [[false],[false,false]];
  125. FeatureUnit9.extraFrames = [[0],[0,0,0]];
  126. FeatureUnit9.osInfo = FeatureUnit9.utils.getOsInfo();
  127. trace("maximum sounds = " + FeatureUnit9.osInfo.maxSounds);
  128. FeatureUnit9.objTrace(FeatureUnit9.osInfo);
  129. FeatureUnit9.addInterval = function(what)
  130. {
  131.    FeatureUnit9.intervals["ID_" + what.toString()] = what;
  132. };
  133. FeatureUnit9.removeInterval = function(what)
  134. {
  135.    var _loc1_ = what;
  136.    trace("********removing" + _loc1_ + ":" + typeof _loc1_);
  137.    delete FeatureUnit9.intervals["ID_" + _loc1_.toString()];
  138.    clearInterval(_loc1_);
  139. };
  140. this.onUnload = function()
  141. {
  142.    var _loc1_ = undefined;
  143.    for(_loc1_ in FeatureUnit9.intervals)
  144.    {
  145.       clearInterval(FeatureUnit9.intervals[_loc1_]);
  146.    }
  147.    FeatureUnit9.mediaManager.shutDown();
  148. };
  149. _global.FeatureUnit9.mediaManager = {};
  150. FeatureUnit9.mediaManager.ini = function()
  151. {
  152.    this.trace("starting ini");
  153.    FeatureUnit9.mediaManager.mediaPlayed = {};
  154.    FeatureUnit9.mediaManager._debugLevel = 0;
  155.    FeatureUnit9.mediaManager.introSoundPlayList = [];
  156.    FeatureUnit9.mediaManager.ambientSoundPlayList = [];
  157.    FeatureUnit9.mediaManager.effectSoundPlayList = [];
  158.    FeatureUnit9.mediaManager.currentIntroSound = null;
  159.    FeatureUnit9.mediaManager.currentAmbientSound = null;
  160.    FeatureUnit9.mediaManager.effectSound = null;
  161.    FeatureUnit9.mediaManager.introSounds = FeatureUnit9.introSounds;
  162.    FeatureUnit9.mediaManager.ambientSounds = FeatureUnit9.ambientSounds;
  163.    FeatureUnit9.mediaManager.soundFadeSpeed = 5;
  164.    FeatureUnit9.mediaManager.currentMedia = null;
  165.    FeatureUnit9.mediaManager.currentMediaInFrame = {};
  166.    FeatureUnit9.mediaManager.currentChapter = -1;
  167.    FeatureUnit9.mediaManager.depthCounter = 1;
  168. };
  169. FeatureUnit9.mediaManager.setMonitorInterval = function()
  170. {
  171.    this.trace("set monitor interval");
  172.    FeatureUnit9.mediaManager.monitorID = setInterval(FeatureUnit9.mediaManager,"monitor",1000);
  173.    FeatureUnit9.addInterval(FeatureUnit9.mediaManager.monitorID);
  174. };
  175. FeatureUnit9.mediaManager.launchMedia = function(clipFileName, selfStartingFlag)
  176. {
  177.    with(this)
  178.    {
  179.       iniSoundsVolume = clipFileName.fadeOtherSoundTo;
  180.       tClip = currentMediaInFrame[clipFileName];
  181.       trace("^^^^^^^^^^^^^^^^ YOU CLICKED ON : " + tClip);
  182.       var okToOpenFlag = true;
  183.       trace("^^^^^^^^^^^^^^^^ currentMedia.active : " + currentMedia.active);
  184.       if(currentMedia.active)
  185.       {
  186.          if(currentMedia.mode == "in")
  187.          {
  188.             currentMedia.close();
  189.          }
  190.          else
  191.          {
  192.             trace("^^^^^^^^^^^^^^^^^^ NOT OK 1 - " + currentMedia.mode);
  193.             okToOpenFlag = false;
  194.          }
  195.       }
  196.       else
  197.       {
  198.          trace("^^^^^^^^^^^^^^^^ currentMedia = " + currentMedia + " && currentMedia.mode = " + currentMedia.mode);
  199.          if(currentMedia.mode == "in")
  200.          {
  201.             currentMedia.close();
  202.             trace("^^^^^^^^^^^^^^^^^^ NOT OK 1 - " + currentMedia.mode);
  203.             okToOpenFlag = false;
  204.          }
  205.       }
  206.       if(currentMedia == tClip)
  207.       {
  208.          if(currentMedia.mode == "terminating")
  209.          {
  210.             trace("^^^^^^^^^^^^^^^^^^ NOT OK 2 - " + currentMedia.mode);
  211.             okToOpenFlag = false;
  212.          }
  213.       }
  214.       trace("^^^^^^^^^^^^^^^^^^^^^^^^^ okToOpenFlag = " + okToOpenFlag);
  215.       if(okToOpenFlag)
  216.       {
  217.          FeatureUnit9.utils.cursor(4);
  218.          currentMedia = tClip;
  219.          tClip.show();
  220.          trace("media type of tClip: " + tClip.mediaType + " - and tClip  = " + tClip + " active " + currentMedia.active);
  221.          if(tClip.mediaType == "VIDEO" || tClip.mediaType == "SOUND")
  222.          {
  223.             if(currentAmbientSound == undefined)
  224.             {
  225.                currentAmbientSound = new Sound();
  226.             }
  227.             if(currentIntroSound == undefined)
  228.             {
  229.                currentIntroSound = new Sound();
  230.             }
  231.             trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FADE OUT BACKGROUND");
  232.             FeatureUnit9.currentSceneName = "section" + File.currentSection + "_mc";
  233.             _global.unit9MediaOpen = true;
  234.             resetVolume = _global.unit9endVolume;
  235.             _level0.backgroundSound.startSoundFade(0,1000);
  236.             FeatureUnit9.removeInterval(currentIntroSound.intervalID);
  237.             currentIntroSound.intervalID = setInterval(currentIntroSound,"fadeOut",50,tClip.fadeOtherSoundTo);
  238.             currentIntroSound.mode = "fadedOut";
  239.             trace("  asdasd a sdasda " + currentIntroSound.mode);
  240.             FeatureUnit9.addInterval(currentIntroSound.intervalID);
  241.             FeatureUnit9.removeInterval(currentAmbientSound.intervalID);
  242.             currentAmbientSound.intervalID = setInterval(currentAmbientSound,"fadeOut",50,tClip.fadeOtherSoundTo);
  243.             currentAmbientSound.mode = "fadedOut";
  244.             trace("  asdasd a sdasda " + currentAmbientSound.mode);
  245.             FeatureUnit9.addInterval(currentAmbientSound.intervalID);
  246.          }
  247.       }
  248.    }
  249.    this.trace("ended launchMedia");
  250. };
  251. FeatureUnit9.mediaManager.monitor = function()
  252. {
  253.    trace("monitoring... " + tClip.active + " mode " + currentIntroSound.mode + " this " + this);
  254.    with(this)
  255.    {
  256.       if(!tClip.active)
  257.       {
  258.          this.trace(5,"monitor: no currentMedia.active");
  259.          this.trace(8,"monitor: currentIntroSound.mode: " + currentIntroSound.mode);
  260.          this.trace(8,"monitor: currentAmbientSound.mode: " + currentAmbientSound.mode);
  261.          if(currentIntroSound.mode == "fadedOut")
  262.          {
  263.             trace("............fading intro in!............");
  264.             fadeBackIntro();
  265.          }
  266.          if(currentAmbientSound.mode == "fadedOut")
  267.          {
  268.             trace("............fading ambient in!............");
  269.             fadeBackAmbient();
  270.          }
  271.       }
  272.    }
  273.    this.trace(4,"monitor: ending");
  274. };
  275. FeatureUnit9.mediaManager.fadeBackIntro = function()
  276. {
  277.    with(this)
  278.    {
  279.       FeatureUnit9.removeInterval(currentIntroSound.intervalID);
  280.       currentIntroSound.intervalID = setInterval(currentIntroSound,"fadeIn",50,100);
  281.       FeatureUnit9.addInterval(currentIntroSound.intervalID);
  282.       currentIntroSound.mode = "fadedIn";
  283.    }
  284. };
  285. FeatureUnit9.mediaManager.fadeBackAmbient = function()
  286. {
  287.    trace("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! FADE IN BACKGROUND");
  288.    FeatureUnit9.currentSceneName = "section" + File.currentSection + "_mc";
  289.    targetVolumeFadeIn = _global.unit9endVolume;
  290.    if(targetVolumeFadeIn < 0)
  291.    {
  292.       targetVolumeFadeIn = 100;
  293.    }
  294.    trace("&&&& _global.unit9endVolume = " + _global.unit9endVolume);
  295.    _global.unit9MediaOpen = false;
  296.    trace("$$$$$$$$$$$$$$$$$$$$$$$$ setting fade to volume to = " + _global.resetVolumeAfterSpoke);
  297.    _level0.backgroundSound.startSoundFade(100,1000);
  298.    with(this)
  299.    {
  300.       FeatureUnit9.removeInterval(currentAmbientSound.intervalID);
  301.       currentAmbientSound.intervalID = setInterval(currentAmbientSound,"fadeIn",50,100);
  302.       FeatureUnit9.addInterval(currentAmbientSound.intervalID);
  303.       currentAmbientSound.mode = "fadedIn";
  304.    }
  305. };
  306. FeatureUnit9.mediaManager.shutDown = function()
  307. {
  308.    this.trace(1,"starting shutdown");
  309.    with(this)
  310.    {
  311.       this.removeSounds(introSoundPlayList);
  312.       this.removeSounds(ambientSoundPlayList);
  313.       this.currentMedia.mc_media.stop();
  314.       currentMediaInFrame.shutDown();
  315.    }
  316.    this.trace(1,"ending shutdown");
  317. };
  318. FeatureUnit9.mediaManager.removeSounds = function(soundList)
  319. {
  320.    var _loc2_ = soundList;
  321.    var _loc1_ = 0;
  322.    while(_loc1_ < _loc2_.length)
  323.    {
  324.       _loc2_[0].stop();
  325.       _loc2_.shift();
  326.       _loc1_ = _loc1_ + 1;
  327.    }
  328. };
  329. FeatureUnit9.mediaManager.pruneSoundList = function(soundList, arrayLength)
  330. {
  331.    var _loc1_ = soundList;
  332.    var _loc2_ = arrayLength;
  333.    while(_loc1_.length > _loc2_)
  334.    {
  335.       _loc1_[0].kill();
  336.       _loc1_.shift();
  337.    }
  338. };
  339. FeatureUnit9.mediaManager.fadeOutFirst = function(tSound)
  340. {
  341.    var _loc1_ = tSound;
  342.    FeatureUnit9.removeInterval(_loc1_.intervalID);
  343.    _loc1_.intervalID = setInterval(_loc1_,"fadeOut",50,-1);
  344.    FeatureUnit9.addInterval(_loc1_.intervalID);
  345. };
  346. FeatureUnit9.mediaManager.launchIntroSound = function(chapterIndex, sectionIndex)
  347. {
  348.    FeatureUnit9.mediaManager.iniSoundsVolume = 100;
  349.    this.assert(!(chapterIndex instanceof Number),"launchIntroSound - chapterIndex is a number? [" + chapterIndex + "]");
  350.    with(this)
  351.    {
  352.       pruneSoundList(introSoundPlayList,1);
  353.       fadeOutFirst(currentIntroSound);
  354.       if(FeatureUnit9.introSounds[chapterIndex][sectionIndex - 1])
  355.       {
  356.          var launchFlag = true;
  357.          if(FeatureUnit9.osInfo.maxSounds < 4)
  358.          {
  359.             if(FeatureUnit9.ambientFirst[chapterIndex][sectionIndex - 1])
  360.             {
  361.                launchFlag = false;
  362.             }
  363.          }
  364.          if(launchFlag)
  365.          {
  366.             this.trace(2,"launchIntroSound - this chapter has an intro");
  367.             this.trace(2,"sectionIndex=" + sectionIndex);
  368.             currentIntroSound = makeSound(introSoundPlayList,chapterIndex,false,"intro_",sectionIndex);
  369.             this.trace(2,"currentIntroSound.name is now: " + currentIntroSound.name);
  370.             introSoundPlayList.push(currentIntroSound);
  371.          }
  372.       }
  373.       else
  374.       {
  375.          trace("Launching silence");
  376.       }
  377.    }
  378. };
  379. FeatureUnit9.mediaManager.launchEffectSound = function(tFileName, looping)
  380. {
  381.    if(FeatureUnit9.osInfo.maxSounds > 5)
  382.    {
  383.       with(this)
  384.       {
  385.          pruneSoundList(effectSoundPlayList,5);
  386.          var tSound = makeSound(effectSoundPlayList,null,false,tFileName,null,true);
  387.          effectSoundPlayList.push(tSound);
  388.       }
  389.    }
  390.    return tSound;
  391. };
  392. FeatureUnit9.mediaManager.launchAmbientSound = function(chapterIndex, sectionIndex)
  393. {
  394.    trace("LAUNCHING AMBIENT SOUND");
  395.    this.trace(1,"starting launchAmbientSound on chapterIndex = " + chapterIndex);
  396.    this.assert(!(chapterIndex instanceof Number),"launchAmbientSound - chapterIndex is a number? [" + chapterIndex + "]");
  397.    with(this)
  398.    {
  399.       var launchFlag = true;
  400.       if(FeatureUnit9.osInfo.maxSounds < 4)
  401.       {
  402.          if(!FeatureUnit9.ambientFirst[chapterIndex][sectionIndex - 1])
  403.          {
  404.             trace("LAUNCH OF AMBIENT SOUND THWARTED");
  405.             launchFlag = false;
  406.             pruneSoundList(ambientSoundPlayList,1);
  407.          }
  408.       }
  409.       trace("checking if sounds enabled etc");
  410.       if(ambientSounds[chapterIndex])
  411.       {
  412.          trace("There is ambient sound enanbled for this chapter");
  413.          if(currentAmbientSound.chapterIndex != chapterIndex)
  414.          {
  415.             FeatureUnit9.mediaManager.fadeOutFirst(currentAmbientSound);
  416.             if(launchFlag)
  417.             {
  418.                currentAmbientSound = makeSound(ambientSound,chapterIndex,true,"ambient_",null);
  419.                currentAmbientSound.sound.setVolume(0);
  420.                ambientSoundPlayList.push(currentAmbientSound);
  421.             }
  422.          }
  423.          else if(launchFlag)
  424.          {
  425.             if(currentAmbientSound.volumeTarget == -1)
  426.             {
  427.                currentAmbientSound = makeSound(ambientSound,chapterIndex,true,"ambient_",null);
  428.                ambientSoundPlayList.push(currentAmbientSound);
  429.             }
  430.          }
  431.          else
  432.          {
  433.             FeatureUnit9.mediaManager.fadeOutFirst(currentAmbientSound);
  434.          }
  435.       }
  436.       else
  437.       {
  438.          trace("there is no ambient sound enanbled for this chapter");
  439.          FeatureUnit9.mediaManager.fadeOutFirst(currentAmbientSound);
  440.       }
  441.    }
  442. };
  443. FeatureUnit9.mediaManager.isAlreadyPlaying = function(soundList, chapterIndex, sectionIndex)
  444. {
  445.    this.trace(1,"starting isAlreadyPlaying on soundList [" + soundList + "] and chapterIndex = " + chapterIndex);
  446.    with(this)
  447.    {
  448.       if(!soundList.length)
  449.       {
  450.          return false;
  451.       }
  452.       if(sectionIndex != undefined)
  453.       {
  454.          return soundList[soundList.length - 1].chapterIndex == chapterIndex && soundList[soundList.length - 1].sectionIndex == sectionIndex;
  455.       }
  456.       return soundList[soundList.length - 1].chapterIndex == chapterIndex;
  457.    }
  458. };
  459. FeatureUnit9.mediaManager.makeSound = function(tArray, chapterIndex, loopingFlag, tSoundFileName, sectionIndex, event)
  460. {
  461.    if(chapterIndex != null)
  462.    {
  463.       tSoundFileName += chapterIndex;
  464.    }
  465.    if(sectionIndex != null)
  466.    {
  467.       tSoundFileName += "_" + sectionIndex;
  468.    }
  469.    this.trace(2,"starting makeSound with : [" + tArray + "], " + chapterIndex + ", " + loopingFlag + ", " + tSoundFileName);
  470.    var mm = this;
  471.    with(this)
  472.    {
  473.       createEmptyMovieClip("sound_" + String(depthCounter),depthCounter % 20);
  474.       var tSound = eval("sound_" + String(depthCounter));
  475.       tSound.ID = "sound_" + String(depthCounter);
  476.       depthCounter++;
  477.       tSound.sound = new Sound(tSound);
  478.       tSound.chapterIndex = chapterIndex;
  479.       tSound.name = tSoundFileName;
  480.       tSound.sound.loadSound(Tardis.Settings.FEATURE_ASSETS + "media/mp3/" + tSound.name + ".mp3",!event);
  481.       tSound.array = tArray;
  482.       tSound.fadeOut = function(volumeTarget)
  483.       {
  484.          var tVolume = this.sound.getVolume() - FeatureUnit9.mediaManager.soundFadeSpeed;
  485.          if(tVolume <= volumeTarget)
  486.          {
  487.             FeatureUnit9.removeInterval(this.intervalID);
  488.             if(tVolume <= 0)
  489.             {
  490.                if(volumeTarget == -1)
  491.                {
  492.                   this.sound.stop();
  493.                   this.array.shift();
  494.                   var tClip = eval(this.ID);
  495.                   tClip.removeMovieClip();
  496.                   delete this;
  497.                   this.volumeTarget = volumeTarget;
  498.                }
  499.                else
  500.                {
  501.                   this.sound.setVolume(0);
  502.                }
  503.             }
  504.             else
  505.             {
  506.                mm.trace(1,"makeSound fadeOut handler - " + this.name + " - setting sound to=" + volumeTarget);
  507.                this.sound.setVolume(volumeTarget);
  508.             }
  509.          }
  510.          else
  511.          {
  512.             this.sound.setVolume(tVolume);
  513.             mm.trace(1,"makeSound fadeOut handler - " + this.name + " -  fadingOut" + tVolume);
  514.          }
  515.       };
  516.       tSound.fadeIn = function(volumeTarget)
  517.       {
  518.          var _loc2_ = this;
  519.          var _loc1_ = _loc2_.sound.getVolume() + FeatureUnit9.mediaManager.soundFadeSpeed;
  520.          if(_loc1_ >= volumeTarget)
  521.          {
  522.             FeatureUnit9.removeInterval(_loc2_.intervalID);
  523.          }
  524.          else
  525.          {
  526.             mm.trace(1,"makeSound - fadeIn handler - volume:" + _loc1_);
  527.             _loc2_.sound.setVolume(_loc1_);
  528.          }
  529.       };
  530.       tSound.kill = function()
  531.       {
  532.          mm.trace(1,"makeSound - kill handler");
  533.          var tClip = eval(this.ID);
  534.          tClip.removeMovieClip();
  535.          FeatureUnit9.removeInterval(this.intervalID);
  536.          this.sound.stop();
  537.          delete this();
  538.          this = null;
  539.       };
  540.       this.trace(3,"makeSound: ambientFlag= " + ambientFlag);
  541.       if(loopingFlag)
  542.       {
  543.          this.trace(3,"makeSound - this is looping");
  544.          tSound.sound.onSoundComplete = function()
  545.          {
  546.             this.start();
  547.          };
  548.       }
  549.       else
  550.       {
  551.          tSound.sound.onSoundComplete = function()
  552.          {
  553.             tSound.kill();
  554.          };
  555.       }
  556.       tSound.sound.onLoad = function()
  557.       {
  558.          this.start();
  559.       };
  560.       tSound.intervalID = setInterval(monitorLoad,40,tSound);
  561.       tSound.watch(intervalID);
  562.       trace("ini ID=" + tSound.intervalID);
  563.       FeatureUnit9.addInterval(tSound.intervalID);
  564.    }
  565.    return tSound;
  566. };
  567. FeatureUnit9.mediaManager.register = function(what)
  568. {
  569.    var _loc1_ = what;
  570.    this.trace("register: " + _loc1_ + " what.filename = " + _loc1_.fileName);
  571.    this.currentMediaInFrame[_loc1_.fileName] = _loc1_;
  572. };
  573. FeatureUnit9.mediaManager.unRegister = function(what)
  574. {
  575.    var _loc1_ = what;
  576.    this.trace("unregister: " + _loc1_ + " what.filename = " + _loc1_.fileName);
  577.    delete this.currentMediaInFrame[_loc1_.fileName];
  578. };
  579. FeatureUnit9.mediaManager.trace = function()
  580. {
  581.    var _loc2_ = undefined;
  582.    var message;
  583.    if(arguments.length > 1)
  584.    {
  585.       _loc2_ = arguments[0];
  586.       message = arguments[1];
  587.    }
  588.    else
  589.    {
  590.       _loc2_ = 1;
  591.       message = arguments[0];
  592.    }
  593.    if(_loc2_ <= this._debugLevel)
  594.    {
  595.       var _loc3_ = "";
  596.       var _loc1_ = 2;
  597.       while(_loc1_ <= _loc2_)
  598.       {
  599.          _loc3_ += ">>";
  600.          _loc1_ = _loc1_ + 1;
  601.       }
  602.       trace(_loc3_ + "FeatureUnit9.mediaManager: " + message);
  603.    }
  604. };
  605. FeatureUnit9.mediaManager.assert = function(result, mesage)
  606. {
  607.    if(!result)
  608.    {
  609.       this.trace("!!!!!!!!!!!!!!!!!!!!!!!! AARGH !!!!!!!!!!!!!!!!!! - asertion failed: " + message);
  610.       stopAllSounds();
  611.       stop();
  612.    }
  613.    else
  614.    {
  615.       this.trace(5,"assertion succeeded: " + mesage);
  616.    }
  617. };
  618. FeatureUnit9.mediaManager.ini();
  619. FeatureUnit9.mediaManager.setMonitorInterval();
  620. FeatureUnit9.playSound = function(what, looping)
  621. {
  622.    trace("playing sound");
  623.    tSound = new Sound();
  624.    tSound.loadSound(Tardis.Settings.FeatureUnit9_ASSETS + "media/mp3/" + what + ".mp3");
  625.    tSound.start();
  626.    if(looping)
  627.    {
  628.       tSound.onSoundComplete = function()
  629.       {
  630.          this.start();
  631.       };
  632.    }
  633. };
  634. trace("FeatureUnit9.runtime=" + FeatureUnit9.runtime);
  635. if(!FeatureUnit9.runtime)
  636. {
  637.    if(FeatureUnit9.debugger == undefined)
  638.    {
  639.       FeatureUnit9.debugger = {};
  640.    }
  641.    FeatureUnit9.debugger.active = true;
  642.    FeatureUnit9.debugger.doCheckFrames = true;
  643.    FeatureUnit9.debugger.checkFrames = function()
  644.    {
  645.       trace("FeatureUnit9.debugger.framesChecked =" + FeatureUnit9.debugger.framesChecked);
  646.       if(FeatureUnit9.debugger.framesChecked == undefined)
  647.       {
  648.          FeatureUnit9.debugger.framesChecked = true;
  649.          var report = "";
  650.          i = 0;
  651.          while(i < FeatureUnit9.navManager.labelList.length)
  652.          {
  653.             var _loc2_ = _currentframe;
  654.             gotoAndPlay(FeatureUnit9.navManager.labelList[i]);
  655.             var _loc1_ = _currentframe;
  656.             if(_loc2_ == _loc1_)
  657.             {
  658.                trace("FRAME MISSING:-->" + FeatureUnit9.navManager.labelList[i]);
  659.             }
  660.             i++;
  661.          }
  662.          trace("FINISHED CHECKING FRAMES");
  663.       }
  664.    };
  665.    FeatureUnit9.debugger.load = function()
  666.    {
  667.       var _loc1_ = this;
  668.       createEmptyMovieClip("debugger",10000);
  669.       debugger._x = 800;
  670.       debugger.loadMovie("debugger.swf");
  671.       _loc1_.dblmID = setInterval(_loc1_,debugLoadMonitor,50);
  672.       FeatureUnit9.addInterval(_loc1_.dblmID);
  673.    };
  674.    FeatureUnit9.debugger.debugLoadMonitor = function()
  675.    {
  676.       if(debugger.getBytesLoaded() == debugger.getBytesTotal())
  677.       {
  678.          debugger.onPress = function()
  679.          {
  680.             trace("ok");
  681.          };
  682.          FeatureUnit9.removeInterval(dblmID);
  683.       }
  684.    };
  685.    if(FeatureUnit9.debugger.active)
  686.    {
  687.       FeatureUnit9.debugger.load();
  688.    }
  689.    if(FeatureUnit9.debugger.doCheckFrames)
  690.    {
  691.       FeatureUnit9.debugger.checkFrames();
  692.    }
  693.    FeatureUnit9.debugger.frameNum = 1;
  694.    FeatureUnit9.debugger.getCurrentFrame = function()
  695.    {
  696.       if(FeatureUnit9.debugger.frameNum != _currentframe)
  697.       {
  698.          FeatureUnit9.debugger.frameNum = _currentframe;
  699.       }
  700.    };
  701.    setInterval(FeatureUnit9.debugger,"getCurrentFrame",20);
  702. }
  703. _global.unit9OpenSpoke = function(fileName, mediaTitle, inTransition, outTransition, duration, playerType, spokeNumber)
  704. {
  705.    if(File.currentSection != undefined)
  706.    {
  707.       spokeTargetPrefix_mc = "_level0.section" + File.currentSection + "_mc.spokePlayer";
  708.    }
  709.    else
  710.    {
  711.       spokeTargetPrefix_mc = "_root.spokePlayer";
  712.    }
  713.    spokeIndex = 1;
  714.    while(spokeIndex < 20)
  715.    {
  716.       spokeTarget_mc = spokeTargetPrefix_mc + spokeIndex + "_mc";
  717.       target_mc = eval(spokeTarget_mc);
  718.       target_mc.gotoAndPlay("closeFrame");
  719.       spokeIndex++;
  720.    }
  721.    if(File.currentSection != undefined)
  722.    {
  723.       spokeTarget_mc = "_level0.section" + File.currentSection + "_mc.spokePlayer" + spokeNumber + "_mc";
  724.    }
  725.    else
  726.    {
  727.       spokeTarget_mc = "_root.spokePlayer" + spokeNumber + "_mc";
  728.    }
  729.    trace("%%%%%%%%%%%%%%%%%%%%%%%%%%% spokeTarget_mc  = " + spokeTarget_mc);
  730.    target_mc = eval(spokeTarget_mc);
  731.    target_mc.fileName = fileName;
  732.    target_mc.mediaTitle = mediaTitle;
  733.    target_mc.inTransition = inTransition;
  734.    target_mc.outTransition = outTransition;
  735.    target_mc.duration = duration;
  736.    target_mc.playerType = playerType;
  737.    switch(playerType)
  738.    {
  739.       case 2:
  740.          target_mc.MCYposition = 40;
  741.          break;
  742.       case 4:
  743.          target_mc.MCYposition = 0;
  744.          break;
  745.       default:
  746.          target_mc.MCYposition = 0;
  747.    }
  748.    trace("%%%%%%%%%%%%%%%%%%%%%%%%%%% target_mc = " + target_mc);
  749.    target_mc.gotoAndPlay(2);
  750. };
  751. _global.unit9spokeSkip = 500;
  752. if(!_global.sceneInit)
  753. {
  754.    _global.sceneInit = function()
  755.    {
  756.    };
  757. }
  758.